import { Pipe, PipeTransform } from '@angular/core';
import {HttpService} from "../../providers/HttpService";

/**
 * Generated class for the ResourcePipe pipe.
 *
 * See https://angular.io/docs/ts/latest/guide/pipes.html for more info on
 * Angular Pipes.
 */
@Pipe({
  name: 'resource',
})
export class ResourcePipe implements PipeTransform {
    /**
     * Takes a value and makes it lowercase.
     */
    transform(value: string, ...args) {
        if (args[0] == 'seven') {
          return HttpService.sevenVideo + value;
        } else if (args[0] == 'images') {
            return HttpService.getImageLink(value);
        } else {
            return HttpService.hurl + '/' + args[0] + '/' + value;
        }
    }
}
